<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="MySimpleTag" uri="simpleTags" %>
<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2020/12/8
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍详情</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/index.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/public.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/reset.css" />">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/detail.css" />">
        <style>
            footer {
                /*position: absolute;*/
                bottom: 0;
                width: 100%;
                line-height: 40px
            }
        </style>
</head>
<body>
<jsp:include page="../banner.jsp">
    <jsp:param name="user" value="${sessionScope.user}"/>
</jsp:include>

<div id="nav">
    <!-- 导航栏版心部分 -->
    <div class="nav_con">
        <ul>
            <li><a href="../">首页</a></li>
            <li><a href="bookList">书目查看</a></li>
            <li><a href="<c:url value="/borrower/currentLendingList" />">当前在借</a></li>
            <li><a href="<c:url value="/borrower/requestList" />">请求记录</a></li>
            <li><a href="<c:url value="/borrower/historyLendingList" />">历史记录</a></li>
        </ul>
    </div>
</div>

<!-- 市场项目那一部分 -->
<div class="case_con">
    <div class="bookDiv bookDetails">
        <div class="bookTitle bookDetailsTitle">书籍信息</div>

        <div class="bookDetailsInfor bookName">
            <div class="bookDetailItem">书名 ：</div>
            <div class="bookDetailItemInfor"><c:out value="${bookEntity.bookName}"/></div>
        </div>
        <div class="bookDetailsInfor bookAuthor">
            <div class="bookDetailItem">ISBN ：</div>
            <div class="bookDetailItemInfor"><c:out value="${bookEntity.isbn}"/></div>
        </div>
        <div class="bookDetailsInfor bookAuthor">
            <div class="bookDetailItem">作者 ：</div>
            <div class="bookDetailItemInfor"><c:out value="${bookEntity.author}"/></div>
        </div>
        <div class="bookDetailsInfor bookDescription">
            <div class="bookDetailItem">出版社 ：</div>
            <div class="bookDetailItemInfor"><c:out value="${bookEntity.publisher}"/></div>
        </div>
        <div class="bookDetailsInfor bookPublisherTime">
            <div class="bookDetailItem">出版时间：</div>
            <div class="bookDetailItemInfor">${bookEntity.publishTime}</div>
        </div>
        <div class="bookDetailsInfor bookDescription">
            <div class="bookDetailItem">描述 ：</div>
            <div class="bookDetailItemInfor">${bookEntity.description}</div>
        </div>
        <div class="bookDetailsInfor bookCollection">
            <div class="bookDetailItem">馆藏 ：</div>
            <div class="bookDetailItemInfor">${bookEntity.copyNumber}</div>
        </div>
        <div class="bookDetailsInfor bookInPavilion">
            <div class="bookDetailItem">在馆 ：</div>
            <div class="bookDetailItemInfor">${bookEntity.remain}</div>
        </div>

    </div>
    <div>
        <button class="bookFunction bookFunction1"
                onclick="window.location.href = '<c:url value="/borrower/borrowingCart"/>'">查看借阅车
        </button>
    </div>
    <div class="bookDiv bookList">
        <div class="bookTitle bookListTitle">书籍列表</div>
        <table border="1">
            <tr>
                <th class="bookHeader">编号</th>
                <th class="bookHeader">位置</th>
                <th class="bookHeader">状态</th>
                <th class="bookHeader">操作</th>
            </tr>
            <c:forEach items="${bookItem}" var="bookItem" varStatus="i">

                <tr>
                    <td><c:out value="${bookItem.bookCode}"/></td>
                    <td><c:out value="${bookItem.location}"/></td>

                    <c:choose>
                        <c:when test="${status[i.index]}">
                            <td><span style="color: blue">审查中</span></td>
                        </c:when>
                        <c:otherwise>
                            <c:if test="${bookItem.status}">
                                <td><span style="color: green">在馆</span></td>
                                <td>
                                    <a href="<c:url value="/borrower/addIntoCart?bookItemId=${bookItem.id}" />">加入借阅车</a>
                                </td>
                            </c:if>
                            <c:if test="${!bookItem.status}">
                                <td><span style="color: red">借出</span></td>
                            </c:if>
                        </c:otherwise>
                    </c:choose>
                </tr>
            </c:forEach>

            </tr>
        </table>
    </div>


        <jsp:include page="../footer.jsp"/>
</body>
</html>
